<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'编辑会议事项'))}
	<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"  >
		<input type="hidden" id="id" name="id" value="{$vo.id}">
		<input type="hidden" id="ajax" name="ajax" value="0">
		<input type="hidden" id="opmode" name="opmode" value="edit">
		<input type="hidden" name="actor" id="actor" >
		<input type="hidden" id="actor_user_id" name="actor_user_id">
		
			<label class="input-label" for="name">标题*：</label>
			
				<input value="{$vo.name}" class="input" type="text" id="name" name="name" check="required" info="请输入标题">
			</div>
		</div>

		
			<label class="input-label" for="name">会议开始时间*：</label>
			
				<input value="{$vo.start_time|substr=0,16}" type="text" id="start_time" name="start_time" readonly="readonly" class="input input-date-time" check="required" info="请输入开始日期">
			</div>
		</div>

		
			<label class="input-label" for="name">会议结束时间*：</label>
			
				<input value="{$vo.end_time|substr=0,16}" type="text" id="end_time" name="end_time" readonly="readonly"
				class="input input-date-time" check="eqt|start_time" info="请输入结束日期，需大于开始时间">
			</div>
		</div>

		<div class="layui-form-item col-xs-6">
			<label class="input-label" for="meeting_room">会议室：</label>
			
				<select  class="input" name="meeting_room" id="meeting_room">
					<option  value="">请选择会议室</option>
					<volist name='room_list' id='room'>
						<option value="{$room.id}">{$room.name}
							<notempty name="room.addr">
								[{$room.addr}]
							</notempty>
							<notempty name="room.num">
								[{$room.num}人]
							</notempty></option>
					</foreach>
				</select>
			</div>
		</div>
		
			<label class="input-label" for="tip_name">会议前提醒时间*：</label>
			
				<input value="{$vo.tip_time}" type="text" id="tip_time" name="tip_time"
				class="input" check="required" info="请输入提醒时间" >
			</div>
		</div>
		<div class=""></div>
		
			<label class="input-label" for="location">参与人员：</label>
			
				<div id="actor_wrap" class="inputbox">
					<a class="pull-right btn btn-link text-center" onclick="popup_actor();"> <i class="fa fa-user"></i> </a>
					<div class="wrap" >
						<span class="address_list">{$vo.actor||show_contact="edit"}</span>
						<span class="text" >
							<input class="letter" type="text"  >
						</span>
					</div>
					<div class="search dropdown ">
						<ul class="dropdown-menu"></ul>
					</div>
				</div>
			</div>
		</div>
		
			<div class="col-xs-12">
				<textarea  class="editor" id="content" name="content" style="width:100%;height:300px;">{$vo.content}</textarea>
			</div>
		</div>
		
			<label class="input-label" >附件：</label>
			
				{:widget('file_upload/edit',array('add_file'=>$vo['add_file']))}
			</div>
		</div>
		
			<div class="col-sm-offset-2 com-sm-10">
				<a class="btn btn-normal" onclick="save()">保存</a>
				<a  class="btn btn-return" onclick="go_return_url();">取消</a>
			</div>
		</div>
	</form>
</block>
<block name="js">
	<script type="text/javascript">
		function popup_actor() {
			winopen("{:url('popup/actor')}", 560, 470);
		}

		function save() {
			$("#actor").val("");
			$("#actor_wrap span.address_list span").each(function() {
				$("#actor").val($("#actor").val() + $(this).text().replace(';', '') + '|' + $(this).attr("title") + ";");
			});
			$("#actor_user_id").val("");
			$("#actor_wrap span.address_list span").each(function() {
				$("#actor_user_id").val($("#actor_user_id").val() + $(this).attr("data") + ",");
			});
			send_form("form_data", "{:url('save')}");
		}


		$(document).on("click", ".inputbox .address_list a.del", function() {
			$(this).parent().parent().remove();
		});

		$(document).ready(function() {

			$("#meeting_room option[value='{$vo.meeting_room}']").attr("selected", "selected");

			$("#basic_slider").noUiSlider({
				start : parseInt('{$vo.priority}'),
				step : 1,
				range : {
					'min' : 1,
					'max' : 5,
				},
			});
			$("#basic_slider").on('change', function() {
				$("div.slider_box .noUi-base").css("background-color", schedule_bg($(this).val()));
				$("#priority").val($(this).val());
			});
			$("div.slider_box .noUi-base").css("background-color", schedule_bg('{$vo.priority}'));

		});
	</script>
</block>